#ifndef PROJECT_CONFIG_H
#define PROJECT_CONFIG_H

#include <string>
#include <vector>
#include <filesystem>
#include <pugixml.hpp>

struct TaskElementAttrTable
{
  std::string CameraID;
  std::filesystem::path path;
};

struct TaskAttrTable
{
  std::string name;
  std::filesystem::path path;
  std::vector<TaskElementAttrTable> originVideoList;
};

struct ProjectAttrTable
{
  std::string name;
  std::filesystem::path path;
  std::string describe;
  std::vector<TaskAttrTable> taskAttrList;
};

class ProjectConfig
{
  public:
    ProjectConfig(const std::string & workspace_path);
    virtual ~ProjectConfig();

    std::vector<std::string> GetProjectList();
    void CreateProject(const std::string & name,const std::string & dirName,const std::string & describe);
    std::string GetProjectPath(const std::string & name);

    std::vector<std::string> GetTaskList(const std::string & project_name);
    std::filesystem::path GetTaskPath(const std::string & project_name,const std::string & task_name);
    bool CreateTask(const std::string & project_name,const std::string & name,const std::string & dirName);

    std::vector<std::string> GetTaskOriginVideoList(const std::string & project_name,const std::string & task_name);
    std::filesystem::path GetTaskOriginVideoPath(const std::string & project_name,const std::string & task_name,const std::string & video_name);
    bool CreateOriginVideo(const std::string & project_name,const std::string & task_name,const std::string & CameraID,const std::string & fileName);

    void SaveData();  //保存工程变更

  private:
    std::filesystem::path WorkspacePath;
    std::vector<ProjectAttrTable> ProjectList;
};

#endif
